package com.kksoft.readcm.a;

import java.io.IOException;
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;

final class ai extends org.apache.http.conn.ssl.SSLSocketFactory
{
  private SSLContext a;

  public ai(ag paramag, KeyStore paramKeyStore) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException
  {
    super(paramKeyStore);
    SSLContext localSSLContext1 = SSLContext.getInstance("TLS");
    this.a = localSSLContext1;
    r localr = new r(this);
    SSLContext localSSLContext2 = this.a;
    TrustManager[] arrayOfTrustManager = new TrustManager[1];
    arrayOfTrustManager[0] = localr;
    localSSLContext2.init(null, arrayOfTrustManager, null);
  }

  public final Socket createSocket()
  {
    try {
		return this.a.getSocketFactory().createSocket();
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return null;
  }

  public final Socket createSocket(Socket paramSocket, String paramString, int paramInt, boolean paramBoolean)
  {
    try {
		return this.a.getSocketFactory().createSocket(paramSocket, paramString, paramInt, paramBoolean);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return paramSocket;
  }
}